package org.everyday;

/**
 * @Author: Tang World
 * @Date: 9/9/2022 下午3:47
 */
public class L1598E {
    public static void main(String[] args) {
        new L1598E().minOperations(new String[]{"./", "../", "./"});
    }

    public int minOperations(String[] logs) {
        // 简单的栈模拟
        int depth = 0;
        for (String log : logs) {
            if ("./".equals(log)) {
                continue;
            } else if ("../".equals(log)) {
                if (depth > 0) {
                    depth--;
                }
            } else {
                depth++;
            }
        }
        return depth;
    }
}
